Giter Site home page Giter Site logo

This project was bootstrapped with Create React App.

Makefile

For easier handling there is a Makefile included. Currently there are two scripts:

make & make run

This starts the django server after you've correctly set it up and also starts the frontend service watching for files.

The API will be available at localhost:8000/api/v1/

make init

Once you have installed Python3.8 you can run this command to setup the backend, having the scripts mentioned in the backend section below run (if everything has been done correctly).

Frontend

Frontend packages are found in the ./frontend/ directory, so run all these commands in there as well as the install script.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Make strings translateable

We are using i18next for internationalization. Use it like below:

  const [t] = useTranslation('menu');
  return (<a href="#">{t('linktext')}</a>);

The argument to useTranslation should generally be the area of the app, often the file name in snake-case.

Backend

Setup

Have python 3.8 installed, then install pipenv via pip install pipenv. In the root directory then run pipenv install --dev to install python packages. Activate the virtual environment with pipenv shell and apply migrations with python ./backend/manage.py migrate.

Starting Server

After having completed the setup, to start the server type python ./backend/manage.py runserver or ./backend/manage.py runserver. At this point, if all the commands were entered correctly, we should see an instance of a Django application running on this address — http://localhost:8000. Make sure to apply migrations every now and then, the console should tell you if there are unapplied migrations.

Creating a superuser

Once you have done the above steps, run pipenv run ./backend/manage.py createsuperuser in the project root when prompted insert the data like email, password, etc. After that is done you can run the server with make in project root and go to http://localhost:8000/admin, login there and see a representation of the database.

Accessing the API Docs

When the server is started, you can go to http://localhost:8000/api/v1/ to see a few of the endpoints. There you can see a representation of the data that is accessible via API. For some you might need an authorisation token. If you want to see these you will have to use a browser plugin like ModHeader, and set a Authorization: Token [your token] header. In the admin view there is also a row for "Tokens", click that and you can access your authentication token.

Covexit's Projects

covexit icon covexit

An online marketplace exclusively for local stores with door-to-door delivery to customers

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.