Skip to content

Astrix1234/charity-run-backend

Repository files navigation

Technologies

  • Node.js with Express.js for the backend, providing a robust framework for building efficient and scalable server-side applications.
  • Mongoose for MongoDB interaction, facilitating object data modeling and database interaction in an asynchronous environment.
  • Passport.js for authentication and JWT (JSON Web Tokens) handling, offering a flexible and modular approach to handling user authentication and secure token generation.
  • Nodemailer for handling email operations, crucial for features like sending verification emails during user registration. This adds a layer of security and user verification to the application.
  • CORS (Cross-Origin Resource Sharing) enabled, ensuring the API can securely handle requests from different domain origins.
  • Dotenv for managing environment variables, allowing easy configuration of the application in different environments without code changes.
  • Docker, with a custom Dockerfile created for the application, enabling easy deployment and environment consistency by containerizing the application. This facilitates smoother development, testing, and production workflows.

Installation

To run the project locally, follow these steps:

  • Clone the repository to your device.
  • Install dependencies using npm install.
  • Create a .env file in the main project directory and configure environment variables (PORT, DB_HOST, SECRET, SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, BACKEND_URL, FRONTEND_URL).
  • Start the local server using npm start.

API Usage

Once the server is running, the API is available at http://localhost:[PORT]/api/. Available endpoints:

Users:

Payment:

  • POST /api/payment/donation body({amount*, email}) *amount in grosze is required, email can be skipped. Gets a link leading to p24 donation

  • POST /api/payment/participate body({amount*, participant*}) *amount in grosze is required, participant required ({ km_, shirt*, shirtGender*, raceID }). Gets a link leading to p24 payment to register participant.

Race:

  • GET api/race - get all participants list from chosen race

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •