GithubHelp home page GithubHelp logo

dikshita-mehta / sahaay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from computersocietyvitc/sahaay

0.0 0.0 0.0 1.45 MB

License: MIT License

Dockerfile 0.14% Python 16.28% JavaScript 45.24% CSS 38.34%

sahaay's Introduction

Sahaay

Sahaay is a Q&A application with grievances/questions being posted as tokens. An open source application developed by the students at IEEE ComSoc VIT Chennai student chapter.

Development

  • Developed using Test Driven Development approach. The testing is automated using TravisCI (travis-ci) and Github Actions
  • The backend is developed using FastAPI(fastapi)
  • The frontend uses flutter and dart.

Docker Setup

  • First install docker desktop from docker-home
  • Then set up git in your local folder using git init
  • Add the git repository to remote git remote add origin <code-url>
  • Pull code from the remote origin git pull origin main
  • Pull docker image from dockerhub using the tab: abhijithganesh/sahaay
  • Setup docker docker-compose build

To setup the live test server, run docker-compose up -d after building the docker image. The live image will then be hosted at https://localhost:8000. The api could be tested using the FastAPI testing interface provided at https://localhost:8000/docs.

Contributing

  • If you want to use/install any library don't use pip install directly. Add the said library to requirements.txt.
    • Add the library in the format:
    • 'library name'>='used version',<'version rounded to first decimal '
    • ex: djangorestframework>=3.12.4,<3.13.0
  • We will have a main fastapi which will contain all user models.
  • For any functions/models, implement tests first in .\tests\.
  • Use proper headers and prefixes for commits and Pull Requests
    • [tests] for testing changes
    • [docker] for docker changes
    • [models] for models and serializers related PRs
    • [views] for functions and permissions related PRs
    • [urls] for urls and routing related PRs
    • [tickets] for commits dealing with ticket class
    • [user] for commits dealing with user class
    • [service] for commits dealing with service class
    • [role] for commits dealing with role class

Writing Tests

All tests should be written before starting to create endpoint routes, to setup constraints to be satisfied by the function/endpoint beforehand.

All tests are stored in the app/tests folder with every separate test file (for every new testing family like user, tickets, etc.) named starting with test_. Similar naming convention is also followed for every test function, following standard pytest naming convention.

While writing tests for unsafe requests(POST, PATCH) use fixtures which are to be defined in the app/tests/fixtures folder.

The tests themselves are of two types:

  • Dependency tests : to test dependency functions like password hashing, backend processing, etc. These are standard python tests and require no special knowledge.
  • Endpoint tests: These are written using the FastAPI testclient library, which in itself uses libraries like starlette, asyncio and pytest-mongodb for setting up a asynchronous endpoint testing environment.

sahaay's People

Contributors

abhijithganesh avatar cool-pants avatar porridgewithraisins 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.