Code Monkey home page Code Monkey logo

tasks-list's Introduction

Tasks List (MERN stack)

Task List Full Stack Project, using the MERN stack, where you can add, delete and update tasks. The project is built using the MERN stack, and is deployed on {add link to deployed site}.

Getting Started

To start with, you need to clone the repository to your local machine. You can do this by running the following command in your terminal:

git clone https://github.com/Ch3ssMaster/tasks-list

Prerequisites

You need to have the following installed on your machine:

  • Node.js
  • MongoDB and MongoDB Compass, then create a database called tasks-list
  • VS Code (optional)

Installing

To install the dependencies, run the following command in the backend and frontent directories of the project:

npm install

Setting up the backend

Create a .env file in the backend directory, and add the following:

MONGO_URI =  mongodb://localhost:27017/tasks-list
TOKEN_SECRET =  5745cd8ca6d25082500c1de070652c8a8e30f0fa4296d18cb05c4985746e7588
PORT =  8000

In case you want to mock tasks for the initial view, run the script:

npm run mock

This will generate a .mongodb file, in the path:

/backend/scripts/output/

That you can run with a click from the VS Code plugin playground.

Running the tests

Unit tests have been carried out with the JEST library, both on the front end and on the back end.

Backend tests

The libraries used for backend testing are:

  • JEST - The testing framework used
  • Supertest - The library used to test the API
  • Cross-env - The library used to set the environment variables

To run the tests, execute the following command:

npm run test

Frontend tests

To test the frontend, the libraries provided by create-react-app have been used.

Additionally, version 0.6.5 of the jest-watch-typeahead library has been installed. The current version is not compatible with react-scripts 5.0.1.

In case you want to manually install the library, run the following command:

npm i -D --exact [email protected]

To run the tests, execute the following command:

npm test

API endpoints

The API endpoints are the following:

Method Endpoint Description
GET / Get all tasks
POST / Add a task
PATCH /:id Update a task
DELETE /:id Delete a task

Deployment

The option chosen to deploy the application has been Vercel.

The frontend is deployed directly through the scripts in the package.json file, while the backend needs a vercel.json file as additional configuration.

For the database, MongoDB Atlas has been used.

The application will be active from today 04/04/2023 until the token expires, 15 days, unless the frontend token is renewed.

To test the backend from another client such as Thunder or Postman, it is available at the URL:

Test the full application online!:

Built With

  • React - The frontend framework used
  • Node.js - The backend framework used
  • Express - The backend framework used
  • MongoDB - The database used

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use Semantic Versioning for versioning.

Authors

License

This project is licensed under the MIT License

tasks-list's People

Contributors

ch3ssmaster avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.