Skip to content

Linktur/SleepTrackingApplication

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SleepTrackingApplication

Project for sum-25 Go-Flutter course

Project overview

We create a web application for track sleep periods of users, with rating system that uses sleep hours as a rating.

Team

  • Ekaterina Zhidkova, team leader, frontend-developer of screens, light/dark themes, and animations
  • Anna Morozova, frontend-developer, working with connection of backend and frontend
  • Anastasia Varfolomeeva, frontend-developer, is responsible for creating tests for Flutter
  • Botalov Egor, backend-developer, working with API, database, JWT-based authentication and authorization
  • Vsevolod Nazmudinov, DevOps, backend-developer, working with API, create Swagger documentation

Setup instructions

  1. Dowload the Docker from [official website](official website), and remeber the login and password
  2. Clone the repo, run in cmd git clone https://github.com/SleepTrackingApplication/SleepTrackingApplication
  3. Go to the SleepTrackingApplication - cd SleepTrackingApplication `
  4. Go to the backend directory - cd backend
  5. Setup the .env file
    1. Copy example files:
    cp development.env.example development.env
    cp staging.env.example staging.env
    1. Edit the files with your local settings:
      • Set your database password
      • Generate a secure JWT key - for example: kZs+3FeTR+Db1YGrEtBbpGe3hC7VOqdtD13KJUPUPLI=
      • Adjust ports if needed
  6. Get the dependencies - go mod tidy
  7. Run docker compose up --build -d for start the Docker
  8. Get the dependencies - flutter get pub
  9. Go to the frontend directory - cd ../frontend
  10. Run flutter run
  11. Follow the instructions in the console
  12. The opened window is our application!

Architecture

architecture The project follows a client-server architecture and consists of three main components:

  • Flutter Frontend – A cross-platform mobile and web application.
  • Go Backend – A RESTful API providing business logic, authentication, and database interaction.
  • PostgreSQL – A relational database used to store user and application data.

Explanation

  • The Flutter client communicates with the backend via HTTPS using RESTful API calls.
  • The Go backend handles request routing, input validation, JWT-based authentication, and communicates with the PostgreSQL database.
  • PostgreSQL stores all application data including users, objects, and their relationships.
  • Swagger (OpenAPI) is used for generating interactive API documentation.
  • All components are containerized and managed using Docker Compose.
  • A CI/CD pipeline is used for automated builds, tests, and deployments.

Api documentation

Swagger

  • You can find the swagger API documentation at http://localhost:8080/swagger/ locally after running Docker

Postman documentation Link

Database structure

Below the structure of PostgreSQL database, we use 1:N relationship becasue 1 user can have multiple sleep periods. database

Board with task tracking Link

CI/CD pipeline

GitHub Actions Link

Source .yml file Link

Testing

  • You can see rusult of tests in CI/CD pipeline

How to run tests locally

  • Open cmd in directory of project

Backend

  1. run cd backend in cmd
  2. run go test ./... in cmd
  3. see the result of tesing in cmd

Frontend

  1. run cd frontend in cmd
  2. run flutter test in cmd
  3. see the result of testing in cmd

Implementation checklist

Technical requirements (20 points)

Backend development (8 points)

  • Go-based backend (3 points) Link
  • RESTful API with Swagger documentation (2 points) Link Link
  • PostgreSQL database with proper schema design (1 point) Link Schema design is in README.md
  • JWT-based authentication and authorization (1 point) Link
  • Comprehensive unit and integration tests (1 point) Link1 Link2 Link3 Link4

Frontend Development (8 points)

  • Flutter-based cross-platform application (mobile + web) (3 points)
  • Responsive UI design with custom widgets (1 point) Link (For example, LevitationAnimation, GentleRotationAnimation, and HoverScaleAnimation)
  • State management implementation (1 point)
  • Offline data persistence (1 point)
  • Unit and widget tests (1 point) Link
  • Support light and dark mode (1 point) Link (You can switch theme from user account)

DevOps & deployment (4 points)

  • Docker compose for all services (1 point) Link
  • CI/CD pipeline implementation (1 point) Link
  • Environment configuration management using config files (1 point) Link
  • GitHub pages for the project (1 point) Link (But couldn't add a picture)

Non-Technical Requirements (10 points)

Project management (4 points)

  • GitHub organization with well-maintained repository (1 point) GitHub organization Repository
  • Regular commits and meaningful pull requests from all team members (1 point) We did commits in several branches for features and then by pull requests we merged them
  • Project board (GitHub Projects) with task tracking (1 point) Link We have done not all we want, so you can see all our progress inside
  • Team member roles and responsibilities documentation (1 point) Team in README.md

Documentation (4 points)

  • Project overview and setup instructions (1 point) In README.md
  • Screenshots and GIFs of key features (1 point) In README.md
  • API documentation (1 point) In README.md
  • Architecture diagrams and explanations (1 point) In README.md

Code quality (2 points)

  • Consistent code style and formatting during CI/CD pipeline (1 point) We add linter to CI/CD
  • Code review participation and resolution (1 point) We do it, but almost through the Telegram chat

Bonus Features (up to 10 points)

  • Localization for Russian (RU) and English (ENG) languages (2 points)
  • Good UI/UX design (up to 3 points) Before starting work Ekaterina created Figma prototype Link
  • Integration with external APIs (fitness trackers, health devices) (up to 5 points)
  • Comprehensive error handling and user feedback (up to 2 points)
  • Advanced animations and transitions (up to 3 points) Link

home_screen.dart: Animations for png-image for rotation and levitation (superimposed on each other) and animation when you hover over the buttons, they increase Other screens: Animation when you hover over the buttons, they increase

  • Widget implementation for native mobile elements (up to 2 points)

Total points implemented: 25/30 (excluding bonus points)

About

Project for sum-25 Go-Flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 36.9%
  • Dart 34.0%
  • C++ 14.4%
  • CMake 11.8%
  • Swift 1.1%
  • C 0.9%
  • Other 0.9%