Skip to content

MERN Calendar backend App using node, express, mongoDB. Deployed using Railway. Serves an api to a frontend

Notifications You must be signed in to change notification settings

augusticor/calendar-back

Repository files navigation

Calendar App - 🗓 - Backend

Calendar app is a web application for manage your life private events using a Calendar. Create an account and start organizing your days.

You are the only admin of your events, being able to:

  • Create events
    • Title, notes (optional), start date, end date
  • Update events
  • Delete events
  • View other people events (now only private events from march 2023)

Visit the deployed app at Calendar App

Check the frontend code and tech stack at Calendar Front github repository

Update

From march 2023 you can only see your events, that means all the events are now private.

What is this repository ?

It's the source code for the backend of the calendar app.

Tech stack

This project was created using the M.E.R.N. stack that stands for MongoDB, Express.js, React.js and Node.js

Backend

Dependencies

Read other project dependencies in the package.json file.

Frontend

Check the frontend code and tech stack at Calendar Front github repository

How to use this project

  1. Rename the .env.template file to .env and prepare to complete the info.
  2. In the .env file, set the PORT your app will be running and the SECRET_JWT_SEED that will be used to sign and verify the json web tokens, it can be any string, the longer the string, the better.
  3. Get the connection string for mongoDB database. Check docs.
  4. Run the app:
  5. Consume the api with the available endpoints, example: get all the events -> GET /host/api/events.

Available endpoints

All the endpoints start with /api/...

/auth -> auth routes file

  • POST /new - Creates a new user (name, email & passsword)
  • POST /login - Login an existing user (email & password)
  • GET /renew - Renews user token, old token must come in headers as "x-token"

/events -> events routes file

When consuming all events routes, the token must come in headers:

headers - "x-token": token given when login

  • POST / - Creates a new event (title, start, end & notes(optional))
  • GET / - Gets all the events
  • PUT /:id - Updates an existing event by id
  • DELETE /:id - Delete an event by id

Available scripts

npm run dev

Starts the node server using nodemon dependency, run this for development purposes, it will automatically detect changes and refresh the server.

npm run start

Run this for production mode, this starts the server using simply node command.

About

MERN Calendar backend App using node, express, mongoDB. Deployed using Railway. Serves an api to a frontend

Topics

Resources

Stars

Watchers

Forks