Git Product home page Git Product logo

universityapp's Introduction

University Web Application

This is web application made for a university project. The users are supposed to be 'Students', 'Professors' and 'Secretaries'.

The Professors can register the grades for each student and for each course taught, while each Student can access his account to see his grades. The Secretaries can add more students and professors to the database, as well as assign courses to professors and students.

Screenshots

Home page:

Login page:

Student Pages:

Professor Pages:

Secretaries Pages:

Details

  • The app was developed with Visual Studio 2022 using Asp.NET Core framework (Model View Controller) version 6.0. The language is C#.

  • For the database we used Microsoft Sql Server 2022 and the DBMS Microsoft SQL Server Management Studio 18/19.

  • Bellow is the relation schema of the database:

  • A technical manual and a user manual are also provided in Greek under the docs folder.

  • The session management is handled with a custom way. The Login is performed with the View Login.cshtml, which has the following action method:

[HttpPost]
public ActionResult Login(User user)
{
    _context = new UniversityDBContext();
    var obj = _context.Users.Where(a => a.Username.Equals(userUsername)
        && a.Password.Equals(user.Password)).FirstOrDefault();

    if (obj != null)
    {
        HttpContext.Session.SetString("username", obj.Username.ToString());
        HttpContext.Session.SetString("userid", obj.Userid.ToString());
        HttpContext.Session.SetString("role",obj.Role.ToString());
        return RedirectToAction("Index", obj.Role);
    }
    return RedirectToAction("Login");
}
  • Through a Post request, an object of type User is sent to the Server (it contains only the Username and Password fields - the rest are null) and checks if a User with the given credentials exists in the database. If no user is found, a redirection is made to the Login page. Alternatively, if the corresponding User object is found, 3 fields are created in the Session:

    1. Username
    2. Userid
    3. Role

Once the user has logged in, the corresponding Controller is utilized. Each action method performs checks in order to evaluate whether the user has the rights to call it. For example, let's see a method from StudentsController:

[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
public IActionResult Grades(string? sortOrder)
{
    if (HttpContext.Session.GetString("userid") == null)
        return View("AuthorizationError");
    if (!(HttpContext.Session.GetString("role").Equals("Students")))
        return View("NoRightsError");

    // rest of the code ...
}
  • Before the business logic of the method is perform, we make sure the user has logged in and has the appropriate role.

Requirements

  • Visual Studio 2022
  • Microsoft Sql Server 2022
  • Microsoft SQL Server Management Studio 18/19

Usage

  1. Clone the repo or download as .zip

  2. Open Microsoft SQL Server Management Studio 18/19 and create a new database

  3. Open the sql scripts located inside the folder SQL_scripts in MSQL Management Studio by choosing File > Open

  4. Execute the sql scripts in the following order:

    • SQLQueryTables.sql
    • SQLQueryInsertsPart1.sql
    • SQLQueryInsertsPart2.sql
    • SQLQueryInsertsPart3.sql
  5. Now you have a database ready and filled with dummy data for testing

  6. Open the .sln file of the project with Visual Studio

  7. Place the correct connection script inside the files appsettings.json and Models/UniversityDBContext.cs

  8. App is now ready! You can use the following accounts:

    • Secretary: username: aboyda0, password: Jgx8bp1zRC
    • Professor: username: cbococka, password: Sc5GIg
    • Student: username: jibbesonu, password: pFVJ4ra

universityapp's People

Contributors

mataktelis11 avatar basilisgiata avatar

Watchers

 avatar

universityapp's Issues

Finalize styling

  • Account pages are empty
  • Professor's Registered Students requires paging?
  • Professors's .csv page requires theming
  • Professor's EditGrades requries work
  • Secretaries AssignCoursesStudents
  • Professor check grade out of bounds

Secretaries

  • add the ability for the Secretary to insert new Students and Professors
  • fix general UI and navigation

Student ver2

  • fix styling for Student's View
  • try to fix bug of radio button

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.